<div class="layuimini-container">
    {if isset($addon.config.tips)}
    <blockquote class="layui-elem-quote layui-text" style="color: #2c79c5">
        <span style="font-weight: bold">{$addon.config.tips.title}</span><br/>
        {$addon.config.tips.value}
    </blockquote>
    {/if}
    <form id="app-form" class="layui-form layuimini-form">
        {foreach $addon.config as $key => $item}
            {if $key == 'tips'}
                <input type="hidden" name="{$item.name}" value="{$item.value}">
            {else}
                <div class="layui-form-item">
                    <label class="layui-form-label">{$item.title}</label>
                    <div class="layui-input-block  {in name="item.type" value="image,images"}layuimini-upload{/in}">
                        {switch $item.type}
                        {case string}
                        <input type="text" name="{$item.name}" class="layui-input" lay-verify="{$item.verify|default=''}" placeholder="请输入{$item.title}" value="{$item.value}">
                        {/case}
                        {case text}
                        <textarea name="{$item.name}" rows="5" class="layui-textarea" placeholder="请输入{$item.name}"></textarea>
                        {/case}
                        {case number}
                        <input type="number" name="{$item.name}" class="layui-input" lay-verify="number" placeholder="请输入{$item.title}" value="{$item.value}" step="{$item.step|default=1}" >
                        {/case}
                        {case date|time|datetime}
                        <input type="text" name="{$item.name}" data-date="" data-date-type="{$item.type}" class="layui-input"  lay-verify="{$item.verify|default=''}" placeholder="请输入{$item.title}" value="{$item.value}">
                        {/case}
                        {case select}
                        <select name="{$item.name}" lay-verify="{$item.verify|default=''}">
                            <option value="" >请选择{$item.title}</option>
                            {foreach $item.content as $k => $v}
                                <option value="{$k}" {if in_array($k,explode(',',$item.value))}selected=""{/if}>{$v}</option>
                            {/foreach}
                        </select>
                        {/case}
                        {case checkbox}
                            {foreach $item.content as $k => $v}
                                <input type="checkbox" name="{$item.name}[{$k}]" value="{$k}" title="{$v}" {if in_array($k,explode(',',$item.value))}checked=""{/if}>
                            {/foreach}
                        {/case}
                        {case radio}
                            {foreach $item.content as $k => $v}
                            <input type="radio" name="{$item.name}" value="{$k}" title="{$v}">
                            {/foreach}
                        {/case}
                        {case image}
                        <input name="{$item.name}" class="layui-input layui-col-xs6"   placeholder="请上传{$item.title}" value="{$item.value|default=''}">
                        <div class="layuimini-upload-btn">
                            <span><a class="layui-btn" data-upload="{$item.name}" data-upload-number="one" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                            <span><a class="layui-btn layui-btn-normal" id="select_{$item.name}" data-upload-select="{$item.name}" data-upload-number="one" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                        </div>
                        {/case}
                        {case images}
                        <input name="{$item.name}" class="layui-input layui-col-xs6"   placeholder="请上传{$item.title}" value="{$item.value|default=''}">
                        <div class="layuimini-upload-btn">
                            <span><a class="layui-btn" data-upload="{$item.name}" data-upload-number="more" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                            <span><a class="layui-btn layui-btn-normal" id="select_{$item.name}" data-upload-select="{$item.name}" data-upload-number="more" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                        </div>
                        {/case}
                        {case r_text}
                        <textarea name="{$item.name}" rows="{$item.rows|default=20}" class="layui-textarea editor" placeholder="请输入{$item.title}">{$item.value|raw|default=''}</textarea>
                        {/case}
                        {default /}
                        <input type="text" name="{$item.name}" class="layui-input" lay-verify="{$item.verify|default=''}" placeholder="请输入{$item.title}" value="{$item.value}">
                        {/switch}
                    </div>
                </div>
            {/if}
        {/foreach}
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">标题</label>-->
<!--            <div class="layui-input-block">-->
<!--                <input type="text" name="title" class="layui-input"  placeholder="请输入标题" value="">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">网址</label>-->
<!--            <div class="layui-input-block">-->
<!--                <input type="text" name="url" class="layui-input"  placeholder="请输入网址" value="">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label required">图片</label>-->
<!--            <div class="layui-input-block layuimini-upload">-->
<!--                <input name="image" class="layui-input layui-col-xs6"   placeholder="请上传图片" value="">-->
<!--                <div class="layuimini-upload-btn">-->
<!--                    <span><a class="layui-btn" data-upload="image" data-upload-number="one" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>-->
<!--                    <span><a class="layui-btn layui-btn-normal" id="select_image" data-upload-select="image" data-upload-number="one" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->


        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>保存配置</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>